On the Ethernet, there is an apparatus that supports different transmission rates or bit widths according to different requirements, and the apparatus is configured to receive and/or send data. Under the precondition that a total rate of the Ethernet is constant, a transmission rate supported by a single data interface of the apparatus is inversely proportional to a quantity of data interfaces included in the apparatus. For example, on the Ethernet with a total rate of 400 gigabits (G), a device A includes 16 first data interfaces that support a rate of 25 G, and a device B includes eight second data interfaces that support a rate of 50 G. The device A receives a first data stream through the first data interface, and bit widths of 16 first data streams that are received by the device A through the 16 first data interfaces are the same. When the device A needs to send data to the device B, the device A converts the received 16 first data streams to eight second data streams. The device A sends the eight second data streams to the device B. Each second data interface of the device B receives one second data stream. The conversion may be referred to as data processing. In a process in which the device A converts the first data stream to the second data stream, a bit width of the second data stream is changed when compared with a bit width of the first data stream. Therefore, the data processing may also be referred to as bit width conversion.
Currently, bit width conversion is mainly implemented by distributing and multiplexing data units included in a data stream. An example in which the device A performs bit width conversion of converting the 16 first data streams to the eight second data streams is used. A manner of implementing bit width conversion by means of distribution and multiplexing specifically includes: the 16 first data interfaces included in the device A may be connected to 16 channels, and each channel is configured to transmit one first data stream. A data unit in the first data stream may carry an alignment marker (AM). Using one first data stream in the 16 first data streams as an example, an AM carried by the first data stream corresponds to a channel that transmits the first data stream. Each first data stream in the 16 first data streams carries one AM. The device A aligns the 16 AMs according to the AM carried by each first data stream, that is, performs a deskew operation by means of alignment marker lock (AM Lock), so that the device A can read the 16 AMs at a same moment before performing bit width conversion on the 16 first data streams, so as to eliminate a skew generated in a transmission process of the 16 first data streams. The device A may multiplex the aligned 16 first data streams, to generate the eight second data streams. In the existing manner of implementing bit width conversion by means of distribution and multiplexing, the device A needs to obtain, before performing bit width conversion, a relative position of the AM carried by each first data stream in the 16 first data streams. The device A performs a deskew operation by means of the AM Lock for the 16 first data streams according to the obtained relative position, to eliminate a skew of each first data stream. An existing method used for eliminating a skew in a data stream increases operation complexity and costs, so that bit width conversion by means of distribution and multiplexing is difficult to deploy and implement.